<!--
$RCSfile: overview.html,v $


Copyright (c) 2005 Sun Microsystems, Inc. All  Rights Reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met: 

- Redistribution of source code must retain the above copyright 
  notice, this  list of conditions and the following disclaimer.

- Redistribution in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in 
  the documentation and/or other materials provided with the
  distribution.

Neither the name of Sun Microsystems, Inc. or the names of 
contributors may be used to endorse or promote products derived 
from this software without specific prior written permission.

This software is provided "AS IS," without a warranty of any 
kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 
WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 
NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 
USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 
ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. 

You acknowledge that this software is not designed or intended for 
use in the design, construction, operation or maintenance of any 
nuclear facility. 

$Revision: 1.11 $
$Date: 2007/09/05 00:21:45 $
$State: Exp $
-->
<body>
Java<sup>TM</sup> Advanced Imaging Image I/O Tools provides JAI read
and write operations which use the
<a href="http://docs.oracle.com/javase/8/docs/technotes/guides/imageio/index.html">Java
Image I/O Framework</a>, image input and output streams which use the
New I/O APIs, and image reader and writer plug-ins.

<h2>JAI Image I/O Operations</h2>

JAI operations which read and write images using the Java Image I/O Framework
are provided in the package {@link com.sun.media.jai.operator}.

<h2>Java Image I/O Streams</h2>

Image I/O stream classes based on the new <code>java.nio</code> I/O APIs,
for use with the "raw" format image reader plug-in, and for reading
discontiguous image data are provided in the package
{@link com.github.jaiimageio.stream}.

<h2>Java Image I/O Reader and Writer Plug-ins</h2>

Several reader and writer plug-ins for use with the Java Image I/O Framework
are provided. A summary of their optional capabilities and metadata support
is given in the following table where <i>F</i> denotes <tt>false</tt>,
<i>T</i> indicates <tt>true</tt>, <i>X</i> signifies that the capability is
irrelevant, and <i>U</i> is a variable which is <code>true</code> if and only
if the image data are uncompressed. Capabilities not listed may be assumed to
revert to the respective defaults for reading and writing.

<p>
<table border=1>
<caption><b>Reader/Writer Plug-in Capability Summary</b></caption>
<tr>
<th>Capability</th>
<th><a href=#BMP>BMP</a></th>
<th><a href=#GIF>GIF</a></th>
<th><a href=#JPEG>JPEG</a></th>
<th><a href=#JPEG2000>JPEG 2000</a></th>
<th><a href=#PCX>PCX</a></th>
<th><a href=#PNG>PNG</a></th>
<th><a href=#PNM>PNM</a></th>
<th><a href=#RAW>Raw</a></th>
<th><a href=#TIFF>TIFF</a></th>
<th><a href=#WBMP>WBMP</a></th>
</tr>
<tr>
<td>{@link javax.imageio.ImageReader#canReadRaster()}</td>
<td>T</td><!-- XXX Add format comment labels here and below -->
<td>X</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>T</td>
<td>F</td>
<td>T</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageReader#isRandomAccessEasy(int)}</td>
<td>U</td>
<td>X</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>T</td>
<td>U</td>
<td>T</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageReader#readerSupportsThumbnails()}</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam#canWriteCompressed()}</td>
<td>T</td>
<td>T</td>
<td>T</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam#canWriteProgressive()}</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam#canWriteTiles()}</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriter#canInsertEmpty(int)}</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriter#canInsertImage(int)}</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriter#canReplacePixels(int)}</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriter#canWriteRasters()}</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>T</td>
<td>F</td>
<td>T</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriter#canWriteEmpty()}</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriter#canWriteSequence()}</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>Stream Metadata</td>
<td>F</td>
<td>T</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>F</td>
<td>T</td>
<td>F</td>
</tr>
<tr>
<td>Standard Image Metadata</td>
<td>T</td>
<td>T</td>
<td>T (reader only)</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>T (reader only)</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td>T</td>
<td>T</td>
<td>T (reader only)</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>T</td>
<td>F</td>
<td>T</td>
<td>T (reader only)</td>
</tr>
</table>
</p>

<h3><a name="BMP">BMP</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the Bitmap (BMP) format. A summary of the attributes of these plug-ins is
given in the following table with more details in the description of the
package {@link com.github.jaiimageio.plugins.bmp}.

<p>
<table border=1>
<caption><b>BMP Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>bmp</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/bmp</td>
</tr>
<tr>
<td>Suffix</td>
<td>bmp</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a
href="./com/sun/media/imageio/plugins/bmp/package-summary.html#ImageMetadata"
>com_sun_media_imageio_plugins_bmp_image_1.0</a></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>{@link com.github.jaiimageio.plugins.bmp.BMPImageWriteParam}</td>
</tr>
<tr>
<td>References</td>
<td>No formal, well-defined specification exists but the
<a href="http://www.faqs.org/faqs/graphics/fileformats-faq/part3/section-18.html">
BMP - Windows Bitmap Format FAQ Entry</a> contains useful information</td>
</tr>
</table>
</p>

<h3><a name="GIF">GIF</a></h3>

An <code>ImageWriter</code> plug-in is provided for the Graphics Interchange
Format (GIF). Animated GIF images may be created using the standard sequence
writing methods defined in {@link javax.imageio.ImageWriter}. By default the
writer creates version "89a" images.

<p>
The writer supports setting output stream metadata from
metadata supplied to the writer in either the native GIF stream metadata format
<code>javax_imageio_gif_stream_1.0</code> or the standard metadata format
<code>javax_imageio_1.0</code>, and setting output image metadata from metadata
supplied to the writer in either the native GIF image metadata format
<code>javax_imageio_gif_image_1.0</code> or the standard metadata format
<code>javax_imageio_1.0</code>. The mapping of standard metadata format to
the GIF native stream and image metadata formats is given in the tables
<a href="#GIFMetadata">below</a>.
</p>

<p>
A global color table is written to the output stream if one of the following
conditions obtains:
<ul>
<li>stream metadata containing a GlobalColorTable element are supplied;</li>
<li>a sequence is being written and image metadata containing a
LocalColorTable element are supplied for the first image in the sequence;
or</li>
<li>image metadata are not supplied or do not contain a LocalColorTable
element.</li>
</ul>
In the first case the global color table in the stream metadata is used, in
the second the local color table in the image metadata is used, and in the
third a global color table is created from the ColorModel or SampleModel of
the (first) image.
</p>

<p>
A local color table is written to the output stream only if image metadata
containing a LocalColorTable element are supplied to the writer, or no image
metadata are supplied to the writer and the local color table which would be
generated from the image itself is not equal to the global color table.
</p>

<p>
A Graphic Control Extension block is written to the output stream only if
image metadata containing a GraphicControlExtension element are supplied to
the writer, or no image metadata are supplied and the local color table
generated from the image requires a transparent index. Application, Plain
Text, and Comment Extension blocks are written only if they are supplied to
the writer via image metadata.
</p>

<a name="GIFMetadata"><p>
<table border=1>
<caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
<tr>
<th>Standard Metadata Component</th>
<th>GIF Native Stream Metadata Component</th>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@index</td>
<td>/GlobalColorTable/ColorTableEntry@index</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@red</td>
<td>/GlobalColorTable/ColorTableEntry@red</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@green</td>
<td>/GlobalColorTable/ColorTableEntry@green</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@blue</td>
<td>/GlobalColorTable/ColorTableEntry@blue</td>
</tr>
<tr>
<td>/Chroma/BackgroundIndex@value</td>
<td>/GlobalColorTable@backgroundColorIndex</td>
</tr>
<tr>
<td>/Data/BitsPerSample@value</td>
<td>/LogicalScreenDescriptor@colorResolution</td>
</tr>
<tr>
<td>/Dimension/PixelAspectRatio@value</td>
<td>/LogicalScreenDescriptor@pixelAspectRatio</td>
</tr>
<tr>
<td>/Dimension/HorizontalScreenSize@value</td>
<td>/LogicalScreenDescriptor@logicalScreenWidth</td>
</tr>
<tr>
<td>/Dimension/VerticalScreenSize@value</td>
<td>/LogicalScreenDescriptor@logicalScreenHeight</td>
</tr>
<tr>
<td>/Document/FormatVersion@value</td>
<td>/Version@value</td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
<tr>
<th>Standard Metadata Component</th>
<th>GIF Native Image Metadata Component</th>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@index</td>
<td>/LocalColorTable/ColorTableEntry@index</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@red</td>
<td>/LocalColorTable/ColorTableEntry@red</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@green</td>
<td>/LocalColorTable/ColorTableEntry@green</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@blue</td>
<td>/LocalColorTable/ColorTableEntry@blue</td>
</tr>
<tr>
<td>/Compression/NumProgressiveScans@value</td>
<td>/ImageDescriptor@interlaceFlag</td>
</tr>
<tr>
<td>/Dimension/HorizontalPixelOffset@value</td>
<td>/ImageDescriptor@imageLeftPosition</td>
</tr>
<tr>
<td>/Dimension/VerticalPixelOffset@value</td>
<td>/ImageDescriptor@imageTopPosition</td>
</tr>
<tr>
<td>/Text/TextEntry@value</td>
<td>/CommentExtensions/CommentExtension@value</td>
</tr>
<tr>
<td>/Transparency/TransparentIndex@value</td>
<td>/GraphicControlExtension@transparentColorIndex
(/GraphicControlExtension@transparentColorFlag is also set to
"TRUE")</td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption><b>GIF Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>gif</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/gif</td>
</tr>
<tr>
<td>Suffix</td>
<td>gif</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>ImageWriteParam <a href="#GIFImageWriteParam">subclass</a></td>
</tr>
<tr>
<td>References</td>
<td>
<A HREF="http://www.w3.org/Graphics/GIF/spec-gif87.txt">
GIF 87a Specification (W3C page)</A>
</td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption>
<b><a name="GIFImageWriteParam">
GIF ImageWriteParam Subclass Attributes</a></b>
</caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Compression Types</td>
<td>"LZW"</td>
</tr>
<tr>
<td>Compression Modes</td>
<td><code>ImageWriteParam.MODE_DEFAULT</code>,
<code>ImageWriteParam.MODE_EXPLICIT</code></td>
</tr>
<tr>
<td>Progressive Modes</td>
<td><code>ImageWriteParam.MODE_COPY_FROM_METADATA</code> (use metadata
setting if provided, otherwise interlaced),
<code>ImageWriteParam.MODE_DEFAULT</code> (interlaced),
<code>ImageWriteParam.MODE_DISABLED (not interlaced)</code>
<br/>(<code>MODE_COPY_FROM_METADATA</code> is initial setting)
</td>
</tr>
</table>
</p>

<h3><a name="JPEG">JPEG</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the JPEG image format. These plug-ins are accelerated using native code.
If security permission settings disallow loading native code, or if the
system property "com.github.jaiimageio.disableCodecLib" is set to "true"
at the time of plug-in registration the service provider will deregister
itself and the plug-ins will not be available.</p>

<p>In addition to providing better performance through native acceleration
for conventional (lossy) JPEG (baseline sequential DCT, 8-bit sample
precision), these plug-ins also support the following additional JPEG coding
processes from ISO-10918-1/ITU-T.81:

<ul>
<li>extended sequential DCT, Huffman coding, 12-bit sample precision
(<code>compressionType</code> set to "JPEG")</li>
<li>lossless Huffman coding, 2- through 16-bit sample precision
(<code>compressionType</code> set to "JPEG-LOSSLESS")</li>
</ul>

as well as the following JPEG coding process from ISO-14495-1/ITU-T.87:

<ul>
<li>near-lossless (encoder only) and lossless (encoder and decoder) context
modeling with adaptive Golomb-type coding, 2- through 16-bit sample precision
(<code>compressionType</code> set to "JPEG-LS")</li>
</ul>
</p>

<p>All subsampling and sub-banding is performed in memory, however, so if
either is required, use of the core JPEG plug-in might be preferable. This
plug-in performs best when the data are pixel interleaved with pixel stride
equal to the number of samples per pixel and color component order G
(grayscale), GA (grayscale with alpha), RGB (red-green-blue),
BGR (blue-green-red), RGBA (red-green-blue with alpha), or CMYK
(cyan-magenta-yellow-black) as appropriate for the color space. Other layouts
will cause data to be reformatted in memory.</p>

<p>If the JPEG reader detects an ICC profile in an APP2 marker segment it
will use it to define the raw {@link javax.imageio.ImageTypeSpecifier}.
If the inferred color space not based on the ICC profile is compatible
with the ICC profile-based color space, then a second
<code>ImageTypeSpecifier</code> derived from this inferred color
space will be included in the {@link java.util.Iterator} returned by
{@link javax.imageio.ImageReader#getImageTypes}. If the iterator contains
more than one type, the first one will be based on the ICC profile and the
second on the inferred color space.</p>

<p>The JPEG reader supports TIFF native image metadata as an extra metadata
format. If the JPEG stream contains an EXIF APP1 marker segment, the primary
IFD contained therein will be available from the metadata tree extracted
using the TIFF extra metadata format name. The <code>IIOMetadata</code>
object returned by the JPEG reader may also be used in a call to
{@link com.github.jaiimageio.plugins.tiff.TIFFDirectory#createFromMetadata
TIFFDirectory.createFromMetadata()} to create a <code>TIFFDirectory</code>
instance from which <code>TIFFField</code>s may be easily extracted.</p>

<p>The JPEG reader supports thumbnails. These may be derived from JFIF APP0,
JFXX APP0, or EXIF APP1 marker segments. Although APP0 marker segments are
not allowed by the EXIF specification, there nevertheless exist EXIF images
which contain them. If there is more than one thumbnail present, the JFIF
thumbnail will be retrieved first, followed by any JFXX thumbnail(s), followed
by any EXIF thumbnail. The source of each respective thumbnail may be
determined by consulting the native image metadata.</p>

<p>The baseline DCT JPEG writer encodes images with from 1 to 4 bands. If
the image is 4-banded with a <code>ColorSpace</code> of type
{@link java.awt.color.ColorSpace#TYPE_CMYK ColorSpace.TYPE_CMYK}, an Adobe
APP14 marker with transform parameter value 0 will be written and the image
components will not be subsampled.</p>

<p>
<table border=1>
<caption><b>JPEG Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Names</td>
<td>jpeg, jpg, jpeg-lossless (ISO 10918-1 lossless),
jpeg-ls (ISO 14495-1 lossless), jfif</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/jpeg</td>
</tr>
<tr>
<td>Suffixes</td>
<td>jpeg, jpg, jls (ISO 14495-1 lossless), jfif</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a
href="http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html#image"
>javax_imageio_jpeg_1.0</a></td>
</tr>
<tr>
<td>Extra Image Metadata</td>
<td><a
href="./com/sun/media/imageio/plugins/tiff/package-summary.html#ImageMetadata"
>com_sun_media_imageio_plugins_tiff_image_1.0</a></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>ImageWriteParam <a href="#JPEGImageWriteParam">subclass</a></td>
</tr>
<tr>
<td>References</td>
<td><a href="http://www.jpeg.org/">JPEG Home Page</a></td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption>
<b><a name="JPEGImageWriteParam">
JPEG ImageWriteParam Subclass Attributes</a></b>
</caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Compression Types</td>
<td>"JPEG" (conventional, lossy JPEG),
"JPEG-LOSSLESS" (ISO-10918-1 lossless),
"JPEG-LS" (ISO-14495-1 lossless)</td>
</tr>
<tr>
<td>Compression Modes</td>
<td><code>ImageWriteParam.MODE_DEFAULT</code> (lossy),
<code>ImageWriteParam.MODE_EXPLICIT</code></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam#isCompressionLossless()}</td>
<td><code>true</code> if and only if <code>compressionType</code> is
<i>not</i> "JPEG"</td>
</tr>
</table>
</p>

<h3><a name="JPEG2000">JPEG 2000</a></h3>

See <a href="http://jai-imageio.github.io/jai-imageio-jpeg2000/javadoc/">JPEG 2000 javadoc</a>

<!--

Java<sup>TM</sup> and native-based <code>ImageReader</code> and
<code>ImageWriter</code> plug-ins are provided for the JPEG 2000 image format.
A summary of the attributes of these plug-ins is given in the table below
with more details in the description of the package
{@link com.github.jaiimageio.plugins.jpeg2000}.
If security permission settings disallow loading native code, or if the
system property "com.github.jaiimageio.disableCodecLib" is set to "true"
at the time of plug-in registration the native service providers will
deregister themselves and the native plug-ins will not be available. If both
the native and Java<sup>TM</sup> plug-ins are registered, the native plug-ins
will have higher precedence in the <code>IIORegistry</code>.</p>

<p>
<table border=1>
<caption><b>JPEG 2000 Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Names</td>
<td>jpeg2000, jpeg 2000</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/jp2, image/jpeg2000</td>
</tr>
<tr>
<td>Suffix</td>
<td>jp2</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a
href="./com/sun/media/imageio/plugins/jpeg2000/package-summary.html#ImageMetadata"
>com_sun_media_imageio_plugins_jpeg2000_image_1.0</a></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageReadParam}</td>
<td>{@link com.github.jaiimageio.plugins.jpeg2000.J2KImageReadParam}</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>{@link com.github.jaiimageio.plugins.jpeg2000.J2KImageWriteParam}</td>
</tr>
<tr>
<td>References</td>
<td>
<a href="http://www.jpeg.org/JPEG2000.html">JPEG 2000 Links</a>
</td>
</tr>
</table>
</p>
-->

<h3><a name="PCX">PCX</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the PCX image format. A summary of the attributes of these plug-ins is
given in the following table.

<p>
<table border=1>
<caption><b>PCX Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>pcx</td>
</tr>
<tr>
<td>MIME Types</td>
<td>image/pcx, image/x-pcx, image/x-windows-pcx, image/x-pc-paintbrush</td>
</tr>
<tr>
<td>Suffixes</td>
<td>pcx</td>
</tr>
<tr>
<td>References</td>
<td>
<a href="http://www.fileformat.info/format/pcx/">
PCX Summary from the Encyclopedia of Graphics File Formats</a><br/>
</td>
</tr>
</table>
</p>

<h3><a name="PNG">PNG</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the Portable Network Graphics (PNG) image format. These plug-ins are
accelerated using native code.
If security permission settings disallow loading native code, or if the
system property "com.github.jaiimageio.disableCodecLib" is set to "true"
at the time of plug-in registration the service provider will deregister
itself and the plug-ins will not be available.</p>

<p>In addition to providing better performance through native acceleration,
these plug-ins also provide the ability to set the compression level and
encoder strategy. All subsampling and sub-banding is performed in memory,
however, so if either of these is required, use of the core PNG plug-in
might be preferable. This plug-in performs best when the data are either
packed bilevel (1 sample per pixel, 1 bit per sample) or pixel
interleaved with pixel stride equal to the number of samples per pixel and
color component order G (grayscale), GA (grayscale with alpha), RGB
(red-green-blue), or RGBA (red-green-blue with alpha) as appropriate for the
color space. Other layouts will cause data to be reformatted in memory.
Currently only bit depths of 1, 8, and 16 are supported.</p>

<p>If the PNG reader detects an ICC profile in an iCCP chunk it
will use it to define the raw {@link javax.imageio.ImageTypeSpecifier}.
If the inferred color space not based on the ICC profile field is compatible
with the ICC profile-based color space, then a second
<code>ImageTypeSpecifier</code> derived from this inferred color
space will be included in the {@link java.util.Iterator} returned by
{@link javax.imageio.ImageReader#getImageTypes}. If the iterator contains
more than one type, the first one will be based on the ICC profile and the
second on the inferred color space.</p>

<p>The PNG writer will write an iCCP chunk to the output if one is in the
native image metadata object provided to the writer, or if the
<code>ColorSpace</code> of the <code>ColorModel</code> of the destination
<code>ImageTypeSpecifier</code> is based on an ICC profile which is not one
of the standard <code>ColorSpace</code>s corresponding to the
<code>ColorSpace.cs_*</code> constants. The destination type is set via
{@link javax.imageio.ImageWriteParam#setDestinationType(ImageTypeSpecifier)
ImageWriteParam.setDestinationType()} and defaults to the
<code>ImageTypeSpecifier</code> of the image being written.</p>

<p>
<table border=1>
<caption><b>PNG Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>png</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/png</td>
</tr>
<tr>
<td>Suffix</td>
<td>png</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a
href="http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files/png_metadata.html"
>javax_imageio_png_1.0</a></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>ImageWriteParam <a href="#PNGImageWriteParam">subclass</a></td>
</tr>
<tr>
<td>References</td>
<td>
<A HREF="http://www.w3.org/Graphics/PNG/">W3C PNG Page</A>
</td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption>
<b><a name="PNGImageWriteParam">
PNG ImageWriteParam Subclass Attributes</a></b>
</caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Compression Types</td>
<td>"DEFAULT", "FILTERED", "HUFFMAN_ONLY"</td>
</tr>
<tr>
<td>Compression Modes</td>
<td><code>ImageWriteParam.MODE_DEFAULT</code>,
<code>ImageWriteParam.MODE_EXPLICIT</code>,
<code>ImageWriteParam.MODE_COPY_FROM_METADATA</code> (initial setting).
</td>
</tr>
<tr>
<td>Compression Quality</td>
<td>Sets compression level as
<code>compressionLevel = (int)(9*(1.0F - compressionQuality))</code>
</tr>
<tr>
<td>Progressive Modes</td>
<td><code>ImageWriteParam.MODE_DEFAULT</code> ("Adam7" interlacing),
<code>ImageWriteParam.MODE_DISABLED</code> (no interlacing),
<code>ImageWriteParam.MODE_COPY_FROM_METADATA</code>  (initial setting).
</td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption>
<b>Mapping Between Standard and Native PNG Image Metadata</b>
</caption>
<tr>
<th>Standard Metadata Component</th>
<th>PNG Native Image Metadata Component</th>
</tr>
<tr>
<td>/Chroma/ColorSpaceType@name</td>
<td>/IHDR@colorType</td>
</tr>
<tr>
<td>/Chroma/NumChannels@value</td>
<td>/IHDR@colorType, /tRNS</td>
</tr>
<tr>
<td>/Chroma/Gamma@value</td>
<td>/gAMA@gamma</td>
</tr>
<tr>
<td>/Chroma/BlackIsZero@value</td>
<td>Always <tt>"TRUE"</tt></td>
</tr>
<tr>
<td>/Chroma/Palette</td>
<td>/PLTE</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@red</td>
<td>/PLTE/PLTEEntry@red</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@green</td>
<td>/PLTE/PLTEEntry@green</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@blue</td>
<td>/PLTE/PLTEEntry@blue</td>
</tr>
<tr>
<td>/Chroma/Palette/PaletteEntry@alpha</td>
<td>/PLTE/PLTEEntry@alpha</td>
</tr>
<tr>
<td>/Chroma/BackgroundIndex@value</td>
<td>/bKGD/bKGD_Palette@index</td>
</tr>
<tr>
<td>/Chroma/BackgroundColor@red</td>
<td>/bKGD/bKGD_RGB@red or /bKGD/bKGD_Grayscale@gray</td>
</tr>
<tr>
<td>/Chroma/BackgroundColor@green</td>
<td>/bKGD/bKGD_RGB@green or /bKGD/bKGD_Grayscale@gray</td>
</tr>
<tr>
<td>/Chroma/BackgroundColor@blue</td>
<td>/bKGD/bKGD_RGB@blue or /bKGD/bKGD_Grayscale@gray</td>
</tr>
<tr>
<td>/Compression/CompressionTypeName@value</td>
<td>Always <tt>"deflate"</tt></td>
</tr>
<tr>
<td>/Compression/Lossless@value</td>
<td>Always <tt>"TRUE"</tt></td>
</tr>
<tr>
<td>/Compression/NumProgressiveScans@value</td>
<td>/IHDR/interlaceMethod@value</td>
</tr>
<tr>
<td>/Data/PlanarConfiguration@value</td>
<td>Always <tt>"PixelInterleaved"</tt></td>
</tr>
<tr>
<td>/Data/SampleFormat@value</td>
<td>/IHDR@colorType</td>
</tr>
<tr>
<td>/Data/BitsPerSample@value</td>
<td>/IHDR@bitDepth, /IHDR@colorType, /tRNS</td>
</tr>
<tr>
<td>/Data/SignificantBitsPerSample@value</td>
<td>/sBIT</td>
</tr>
<tr>
<td>/Dimension/PixelAspectRatio@value</td>
<td>/pHYs@pixelsPerUnitYAxis//pHYs@pixelsPerUnitXAxis or 1.0</td>
</tr>
<tr>
<td>/Dimension/ImageOrientation@value</td>
<td>Always <tt>"Normal"</tt></td>
</tr>
<tr>
<td>/Dimension/HorizontalPixelSize@value</td>
<td>/pHYs@pixelsPerUnitXAxis, /pHYS@unitSpecifier</td>
</tr>
<tr>
<td>/Dimension/VerticalPixelSize@value</td>
<td>/pHYs@pixelsPerUnitYAxis, /pHYS@unitSpecifier</td>
</tr>
<tr>
<td>/Document/ImageModificationTime@value</td>
<td>/tIME</td>
</tr>
<tr>
<td>/Text/TextEntry</td>
<td>/tEXt, /iTXt, /zTXt</td>
</tr>
<tr>
<td>/Transparency/Alpha@value</td>
<td>/IHDR@colorType, /tRNS@alpha</td>
</tr>
<tr>
<td>/Transparency/TransparentColor@value</td>
<td>/tRNS</td>
</tr>
</table>
</p>

<h3><a name="PNM">PNM</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the "portable anymap" (PNM) image format which refers collectively to the
formats PBM (portable bitmap), PGM (portable graymap), and PPM (portable
pixmap). A summary of the attributes of these plug-ins is given in the
following table with more details in the description of the package
{@link com.github.jaiimageio.plugins.pnm}.

<p>
<table border=1>
<caption><b>PNM Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>pnm</td>
</tr>
<tr>
<td>MIME Types</td>
<td>image/x-portable-anymap, image/x-portable-bitmap
image/x-portable-graymap,image/x-portable-pixmap</td>
</tr>
<tr>
<td>Suffixes</td>
<td>pbm, pgm, ppm</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a
href="./com/sun/media/imageio/plugins/pnm/package-summary.html#ImageMetadata"
>com_sun_media_imageio_plugins_pnm_image_1.0</a></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>{@link com.github.jaiimageio.plugins.pnm.PNMImageWriteParam}</td>
</tr>
<tr>
<td>References</td>
<td>
<a href="http://netpbm.sourceforge.net/doc/#lbAD">The Netpbm Formats</a>,<br/>
<a href="http://netpbm.sourceforge.net/doc/pbm.html">Manpage of pbm</a>,<br/> 
<a href="http://netpbm.sourceforge.net/doc/pgm.html">Manpage of pgm</a>,<br/> 
<a href="http://netpbm.sourceforge.net/doc/ppm.html">Manpage of ppm</a><br/>
</td>
</tr>
</table>
</p>

<h3><a name="RAW">Raw</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the "raw" image format. The <code>ImageReader</code> plug-in for the
"raw" format requires an input which is a
{@link com.github.jaiimageio.stream.RawImageInputStream}.

<p>The reader plug-in reads any uncompressed data defined by 
<code>ComponentSampleModel</code>,
<code>SinglePixelPackedSampleModel</code> or 
<code>MultiPixelPackedSampleModel</code> as viewed via the 
<code>ImageInputStream</code>.  For example, if extra data are prepended or
appended to image lines,
{@link com.github.jaiimageio.stream.SegmentedImageInputStream} may be used
to define the location of the image data for each line. Thus, if the
data viewed from <code>RawImageInputStream</code> are defined by the
<code>SampleModel</code>s above
 after <code>RawImageInputStream</code> is chained with 
 <code>SegmentedImageInputStream</code>, the reader plug-in can decode these 
 data correctly.

<p> The writer plug-in writes the data to the stream exactly as defined by
the <code>SampleModel</code>.  If the <code>SampleModel</code> has a
scanline stride associated with it, this will be used to determine the length
of each line written.  If only the actual image data and not any prefix or
suffix data on the line are to be written and the scanline stride is greater
than the <code>SampleModel</code> width multiplied by the number of bands, 
the image should first be reformatted to remove the extra data. If JAI 
is available the "Format" operation may be used for reformatting the data.</p>

<p>
<table border=1>
<caption><b>Raw Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>raw</td>
</tr>
<tr>
<td>MIME Type</td>
<td>none</td>
</tr>
<tr>
<td>Suffix</td>
<td>none</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>ImageWriteParam <a href="#RawImageWriteParam">subclass</a></td>
</tr>
<tr>
<td>References</td>
<td>XML {@link org.xml.sax.InputSource} defined at
{@link com.github.jaiimageio.stream.RawImageInputStream#RawImageInputStream(javax.imageio.stream.ImageInputStream,org.xml.sax.InputSource)}</td>
</tr>
</table>
</p>

<p>
<table border=1>
<caption>
<b><a name="RawImageWriteParam">
Raw ImageWriteParam Subclass Attributes</a></b>
</caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Tiling Modes</td>
<td><code>ImageWriteParam.MODE_DEFAULT</code></td>
</tr>
</table>
</p>


<h3><a name="TIFF">TIFF</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the Tag(ged) Image File Format (TIFF). A summary of the attributes of these
plug-ins is given in the table below with more details in the description
of the package {@link com.github.jaiimageio.plugins.tiff}. Native code
is used to accelerate bilevel encodings. If security permission settings
disallow loading native code, or if the system property
"com.github.jaiimageio.disableCodecLib" is set to "true" at the time of
(de)compression, native acceleration will not be used.</p>

<p>
<table border=1>
<caption><b>TIFF Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Names</td>
<td>tif, tiff</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/tiff</td>
</tr>
<tr>
<td>Suffixes</td>
<td>tif, tiff</td>
</tr>
<tr>
<td>Native Stream Metadata</td>
<td><a
href="./com/sun/media/imageio/plugins/tiff/package-summary.html#StreamMetadata"
>com_sun_media_imageio_plugins_tiff_stream_1.0</a></td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a
href="./com/sun/media/imageio/plugins/tiff/package-summary.html#ImageMetadata"
>com_sun_media_imageio_plugins_tiff_image_1.0</a></td>
</tr>
<tr>
<td>{@link javax.imageio.ImageReadParam}</td>
<td>{@link com.github.jaiimageio.plugins.tiff.TIFFImageReadParam}</td>
</tr>
<tr>
<td>{@link javax.imageio.ImageWriteParam}</td>
<td>{@link com.github.jaiimageio.plugins.tiff.TIFFImageWriteParam}</td>
</tr>
<tr>
<td>References</td>
<td>
<a href="http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">
TIFF 6.0 Specification</a> (PDF),<br/>
<a href="http://partners.adobe.com/public/developer/en/tiff/TIFFPM6.pdf">
TIFF Specification Supplement 1</a> (PDF),<br/>
<a href="http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf">
TIFF Specification Supplement 2</a> (PDF) (covers ZLIB and JPEG
compression in TIFF),<br/>
<a href="http://home.earthlink.net/~ritter/tiff/">
The Unofficial TIFF Home Page</a>,<br/>
<a href="http://www.libtiff.org/">TIFF Software</a> (<i>libtiff</i>),<br/>
<a href="http://palimpsest.stanford.edu/bytopic/imaging/std/tiff-f.html">
TIFF-F</a> Revised Specification,<br/>
<a href="ftp://ftp.sgi.com/graphics/tiff/TTN2.draft.txt">JPEG-in-TIFF</a>
 compression,<br/>
<a href="http://www.isi.edu/in-notes/rfc1951.txt">
DEFLATE</a> specification (<i>Zip-in-TIFF</i>),<br/>
<a href="http://www.isi.edu/in-notes/rfc1950.txt">
ZLIB</a> specification (<i>Zip-in-TIFF</i>),<br/>
<a href="http://www.color.org/ICC1V42.pdf">ICC Specification</a> (PDF):
section B.4: Embedding ICC profiles in TIFF files,<br/>
<a href="http://www.exif.org/">EXIF and related resources</a>
</td>
</tr>
</table>
</p>

<h3><a name="WBMP">WBMP</a></h3>

<code>ImageReader</code> and <code>ImageWriter</code> plug-ins are provided
for the Wireless Bitmap (WBMP) image format. A summary of the attributes of
these plug-ins is given in the following table.

<p>
<table border=1>
<caption><b>WBMP Reader/Writer Plug-in Attributes</b></caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>Format Name</td>
<td>wbmp</td>
</tr>
<tr>
<td>MIME Type</td>
<td>image/vnd.wap.wbmp</td>
</tr>
<tr>
<td>Suffix</td>
<td>wbmp</td>
</tr>
<tr>
<td>Native Image Metadata</td>
<td><a href="#WBMPNativeImageMetadata">
com_sun_media_imageio_plugins_wbmp_image_1.0</a></td>
</tr>
<tr>
<td>References</td>
<td>
<i>WAP Media Types Specification</i> (PDF) available from
<a href="http://www.wapforum.org/what/technical.htm">
WAP Forum Specifications</a> and
<a href="http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html#wap20">
Open Mobile Alliance</a>
</td>
</tr>
</table>
</p>

<p>
<h4><a name="WBMPNativeImageMetadata">
Image Metadata</a></h4>

The XML schema for the WBMP native image metadata format is as follows:

<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;!-- Schema for WBMP native image metadata format. --&gt;

&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://com.github.jaiimageio.plugins"
            targetNamespace="http://com.github.jaiimageio.plugins"&gt;

  &lt;!-- WBMP Schema 1.0 root element. --&gt;
  &lt;xsd:element name="com_sun_media_imageio_plugins_wbmp_image_1.0"&gt;
    &lt;xsd:complexType&gt;
      &lt;xsd:sequence&gt;

        &lt;!-- WBMP type --&gt;
        &lt;xsd:element name="WBMPType" type="xsd:unsignedInt"/&gt;

        &lt;!-- Bitmap width --&gt;
        &lt;xsd:element name="Width" type="xsd:unsignedInt"/&gt;

        &lt;!-- Bitmap height --&gt;
        &lt;xsd:element name="Height" type="xsd:unsignedInt"/&gt;

      &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
  &lt;/xsd:element&gt; &lt;!-- wbmp_image_1.0 --&gt;

&lt;/xsd:schema&gt;
</pre>

</p>

@since 1.0

</body>
